package com.wangzhenyu.learn.test.view

import android.content.Context
import android.graphics.Canvas
import android.util.AttributeSet
import android.view.View
import com.wangzhenyu.common.util.log.LogUtil

class TestView @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr) {

    override fun onFinishInflate() {
        super.onFinishInflate()
        LogUtil.default01("onFinishInflate")
    }

    override fun onAttachedToWindow() {
        super.onAttachedToWindow()
        LogUtil.default01("onAttachedToWindow")
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)
        LogUtil.default01("onMeasure")
    }

    override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
        super.onLayout(changed, left, top, right, bottom)
        LogUtil.default01("onLayout")
    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        LogUtil.default01("onDraw")
    }

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        LogUtil.default01("onDetachedFromWindow")
    }
}